import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/home',
    children:[
      {path: '/home', component: () => import('../views/home/homepageView.vue')},
      {path: '/user', component: () => import('../views/peopleManagement/userView.vue')},
      {path: '/rider', component: () => import('../views/peopleManagement/riderView.vue')},
      {path: '/order', component: () => import('../views/orderManagement/orderView.vue')},
    ]
  },
  {
    path:'/login',
    component: ()=>import('../views/loginView.vue')
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
